﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/Default.master" AutoEventWireup="true"
    CodeFile="Add.aspx.cs" Inherits="List_Add" Title="豆列维护" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table>
        <tr>
            <td>
                豆列名称：
            </td>
            <td>
                <asp:TextBox ID="tbListName" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                对应栏目：
            </td>
            <td>
                <asp:DropDownList ID="ddlMenu" runat="server" DataTextField="Name" DataValueField="ID">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                进度 ：
            </td>
            <td>
                已添加：<asp:Label ID="lbAmount" runat="server">0</asp:Label>/总数：<asp:TextBox ID="tbTotal"
                    runat="server"></asp:TextBox>
                <asp:RegularExpressionValidator ID="revTotal" runat="server" ControlToValidate="tbTotal"
                    Display="Static" ErrorMessage="总数必须为数字。" ValidationExpression="\d"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td>
                说明 ：
            </td>
            <td>
                <asp:TextBox ID="tbListRemark" runat="server" Height="150px" TextMode="MultiLine"
                    Width="400px"></asp:TextBox>
            </td>
        </tr>
        <tr id="trCreateTime" runat="server">
            <td>
                创建时间：
            </td>
            <td>
                <asp:Label ID="tbListCreateTime" runat="server"></asp:Label>
            </td>
        </tr>
        <tr id="trList" runat="server">
            <td>
                影片 ：（输入IMDB编号）
            </td>
            <td>
                <asp:GridView ID="gvList" border="0" align="center" CellPadding="0" CellSpacing="0"
                    runat="server" AutoGenerateColumns="False" PageSize="15" Width="95%" OnRowCommand="gvList_RowCommand"
                    OnRowDataBound="gvList_RowDataBound">
                    <EmptyDataTemplate>
                        <font style="color: red; font-weight: bold; font-size: larger;">无符合条件的记录</font>
                    </EmptyDataTemplate>
                    <RowStyle HorizontalAlign="Center" />
                    <Columns>
                        <asp:TemplateField HeaderText="IMDB编号">
                            <ItemTemplate>
                                <asp:Label ID="lbIMDB" runat="server" Text='<%#Eval("IMDB_ID")%>' Visible="true"></asp:Label>
                                <asp:TextBox ID="tbIMDB" runat="server" Text='<%#Eval("IMDB_ID")%>' Visible="false"></asp:TextBox>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="名称">
                            <ItemTemplate>
                                <asp:Label ID="tbName" runat="server" Text='<%#Eval("OriginalName")%>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="添加时间">
                            <ItemTemplate>
                                <asp:Label ID="tbCreateTime" runat="server" Text='<%#Eval("CreateTime")%>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="排序号">
                            <ItemTemplate>
                                <asp:TextBox ID="tbSortIndex" runat="server" Text='<%#Eval("SortIndex")%>'></asp:TextBox>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="说明">
                            <ItemTemplate>
                                <asp:TextBox ID="tbRemark" runat="server" Text='<%#Eval("Remark")%>'></asp:TextBox>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="操作" ItemStyle-Width="140px">
                            <ItemTemplate>
                                <asp:Button ID="btnEdit" runat="server" Text="保存" CommandName="btnEdit" Visible="true"
                                    CommandArgument='<%# Container.DataItemIndex %>' />
                                <asp:Button ID="btnDel" runat="server" Text="删除" CommandName="btnDel" CommandArgument='<%#Eval("ID")%>'
                                    OnClientClick="return window.confirm('您真的要删除吗？')" />
                                <asp:Button ID="btnAdd" runat="server" Text="新增" CommandName="btnAdd" Visible="false"
                                    CommandArgument='<%# Container.DataItemIndex %>' />
                                <asp:Label ID="lblID" runat="server" Text='<%#Eval("ID")%>' Visible="false"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Button ID="btnAdd" runat="server" Text="提交" OnClick="btnAdd_Click"></asp:Button>
            </td>
        </tr>
    </table>
</asp:Content>
